package com.sinothk.gpserver.modules.biz.controller;

import com.sinothk.gpserver.modules.biz.entity.CommVo;
import com.sinothk.gpserver.modules.biz.entity.SearchUserEntity;
import com.sinothk.gpserver.modules.biz.entity.ShowInfo;
import com.sinothk.gpserver.modules.biz.entity.UserOperateInfo;
import com.sinothk.gpserver.modules.biz.service.ICommService;
import com.sinothk.gpserver.modules.comm.base.controller.BaseController;
import com.sinothk.server.support.annotation.callback.ResponseResult;
import com.sinothk.server.support.entity.PageData;
import com.sinothk.server.support.entity.PageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 公共功能
 * </p>
 *
 * @author Liang Y.t.
 * @since 2021-08-28
 */
@Api(tags = "公共功能")
@RequestMapping("/comm")
@ResponseResult()
@RestController
public class CommController extends BaseController {

    @Autowired
    private ICommService commService;

    @ApiOperation(value = "分页列表-关键字搜索用户", notes = "分页列表-关键字搜索用户")
    @PostMapping("/searchUserByKeywords")
    public PageData<SearchUserEntity> searchUserByKeywords(@RequestBody PageVo<CommVo> pageVo) {
        return commService.searchUserByKeywords(pageVo);
    }

    @ApiOperation(value = "展示信息", notes = "展示信息")
    @GetMapping("/showInfo")
    public ShowInfo showInfo() {
        return commService.getShowInfo();
    }

    @ApiOperation(value = "个人操作统计信息", notes = "个人操作统计信息")
    @GetMapping("/getUserOperateInfo")
    public UserOperateInfo getUserOperateInfo() {
        return commService.getUserOperateInfo();
    }
}

